﻿+function ($) {

    $(function () {

         

        // ajax modal
        $(document).on('click', '[data-toggle="ajaxModal"]',
            function (e) {

                e.preventDefault();

                var $this = $(this), $remote = $this.data('remote') || $this.attr('href');

                Ext.net.directRequest({
                    cleanRequest: true,
                    url: $remote,
                    //extraParams: params,
                    method: "GET",
                    control: this,
                    eventMask: {
                        showMask: true,
                        msg: "正在打开..."
                    }
                });

                //var $this = $(this)
                //    , $remote = $this.data('remote') || $this.attr('href')
                //    , $modal = $('<div></div>');//用来作容器
                //$modal.attr("tips", "用来作容器");
                //$('body').append($modal);

                //$modal.load($remote, function (response, status, xhr) {
                //    var newmodal = $modal.children("div").modal();
                //    newmodal.modal('show');

                //    //给新加载的界面注册表单验证
                //    $.validator.unobtrusive.parse($('#modalcontent form'));
                //    $('#modalcontent form').validateBootstrap();
                //});
            }
        );

        
    });
}(jQuery);